package com.yao.serviceimpl;

import com.yao.dao.VirtualDao;
import com.yao.entity.VirtualEntity;
import com.yao.service.ServerService;
import com.yao.service.VirtualService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class VirtualServiceImpl implements VirtualService {
    @Autowired
    private VirtualDao virtualDao;
    //    重写service接口的方法

    //全局查找
    @Override
    public List<VirtualEntity> findAll(){
        return virtualDao.findAll();
    }

    //全局查找分页
    @Override
    public List<VirtualEntity> findPage(int page,int pageSize){
        return virtualDao.findPage(page,pageSize);
    }

    //模糊查询
    @Override
    public List<VirtualEntity> findBySomething(String virtual_ip,String app,String ip,
                String admin,String core,String ram,String disk,String systems,String zabbix){
        return virtualDao.findBySomething(virtual_ip,app,ip,admin,core,ram,disk,systems,zabbix);
    }

    //模糊查询分页
    @Override
    public List<VirtualEntity> findByPage(String virtual_ip,String app,String ip,
        String admin,String core,String ram,String disk,String systems,String zabbix,int page,int pageSize){
        return virtualDao.findByPage(virtual_ip,app,ip,admin,core,ram,disk,systems,zabbix,page,pageSize);
    }

    //删除
    @Override
    public void delete(int id){
        virtualDao.delete(id);
    }

    //修改
    @Override
    public void update(int id,String virtual_ip,String app,String virtual_name,String ip,String admin,
                String core,String ram,String disk,String systems,String zabbix,String remark){
        virtualDao.update(id,virtual_ip,app,virtual_name,ip,admin,core,ram,disk,systems,zabbix,remark);
    }

    //添加
    @Override
    public void add(String virtual_ip,String app,String virtual_name,String ip,String admin,
             String core,String ram,String disk,String systems,String zabbix,String remark){
        virtualDao.add(virtual_ip,app,virtual_name,ip,admin,core,ram,disk,systems,zabbix,remark);
    }
}
